"""
功能描述 ：
编写人 ：
编写日期 ：
实现逻辑 ：
    1- ......
        1.1- ......
    2- ......
        2.1- ......
"""
#列表常用操作
#下标
# name_list = ['chen', 'yu', 'song']
# print(name_list[0])
# #函数
# print(len(name_list))
# print(name_list.count('yu'))
# #判断是否存在
# print('yu'in name_list)
# print('yu'not in name_list)
# #增加 append 列表末尾追加数据
# name_list.append('yunhejiuexiao')
# print(name_list)
#如果append()追加的数据是⼀个序列，则追加整个序列到列表
# name_list = ['yun','he','jiu','xiao']
# name_list.append(['long','teng','si','hai'])
# print(name_list)
#extend()：列表结尾追加数据，如果数据是⼀个序列，则将这个序列的数据逐⼀添加到列表
# name_list = ['yun','he','jiu','xiao']
# name_list.extend('long')
# print(name_list)
#
# name_list = ['yun','he','jiu','xiao']
# name_list.extend(['long','teng','si','hai'])
# print(name_list)
#insert()：指定位置新增数据
# name_list = ['yun','jiu','xiao']
# name_list.insert(1,'he')
# print(name_list)
# #删除
# #删除整个列表
# del name_list
# print(name_list)
# #删除指定数据
# name_list = ['yun','jiu','xiao']
# del name_list[1]
# print(name_list)
#remove()：移除列表中某个数据的第⼀个匹配项
# name_list  = ['yun','he','jiu','xiao']
# name_list.remove('he')
# print(name_list)
# # clear()：清空列表
# name_list = ['Tom', 'Lily', 'Rose']
# name_list.clear()
# print(name_list)
#修改
name_list = ['long','teng','si','hai']
#修改指定下标数据
name_list[0] = 'aaa'
print(name_list)
#逆置：reverse()
new_name_list = ['1','4','6','7','3','8']
# new_name_list.reverse()
# print(new_name_list)
#排序：sort()
# new_name_list.sort()
# print(new_name_list)
#复制
new_list1 = new_name_list.copy()
print(new_list1)
#循环
#while循环
name_list = ['Tom', 'Lily', 'Rose']
i = 0
while i < len(name_list):
    print(name_list[i])
    i +=1

#for循环
for i in name_list:
    print(i)
#列表嵌套
name_list = [['⼩明', '⼩红', '⼩绿'], ['Tom', 'Lily', 'Rose'], ['张三', '李四',
'王五']]
print(name_list[2][1])